# -*- coding:utf-8 -*-
# Author：FeiHu

import numpy as np

F = np.matrix([[1, 1], [1, 0]])
print('F ', F)

print("8th Fibonacci ", (F ** 7)[0, 0])

n = np.arange(1,9)
sqrt5 = np.sqrt(5)
phi = (1+sqrt5)/2
fibonacci = np.rint((phi ** n - (-1/phi) ** n)/ sqrt5)
print("Fibonacci ", fibonacci)